#include <iostream>
#include <vector>
#include <utility>
#include <algorithm>
#include <functional>
using namespace std;

int main()
{
    vector<int> v = {1,1,2,1,1};
    vector<pair<int, int>> vp;
    vp.push_back(make_pair(1, 3));
    vp.push_back(make_pair(1, 2)); 
    vp.push_back(make_pair(1, 1)); 
    vp.push_back(make_pair(2, 0));
    // for(int i = 0; i < v.size(); i++)
    // {
    //     vp.push_back(make_pair(v[i], i));
    // }
    for (int i = 0; i < vp.size(); i++)
    {
        cout << vp[i].first << " " << vp[i].second << endl;
    }
    cout << "==================================" << endl;  
    sort(vp.begin(), vp.end());
    for (int i = 0; i < vp.size(); i++)
    {
        cout << vp[i].first << " " << vp[i].second << endl;
    }
    // stable_sort(vp.begin(), vp.end());
    // for (int i = 0; i < vp.size(); i++)
    // {
    //     cout << vp[i].first << " " << vp[i].second << endl;
    // }
    return 0;
}